(0) Obligation:

The Runtime Complexity (innermost) of the given CpxTRS could be proven to be BOUNDS(1, n^2).


The TRS R consists of the following rules:

minus(X, 0) → X
minus(s(X), s(Y)) → p(minus(X, Y))
p(s(X)) → X
div(0, s(Y)) → 0
div(s(X), s(Y)) → s(div(minus(X, Y), s(Y)))

Rewrite Strategy: INNERMOST

(1) CpxTrsToCdtProof (BOTH BOUNDS(ID, ID) transformation)

Converted Cpx (relative) TRS to CDT

(2) Obligation:

Complexity Dependency Tuples Problem
Rules:

minus(z0, 0) → z0
minus(s(z0), s(z1)) → p(minus(z0, z1))
p(s(z0)) → z0
div(0, s(z0)) → 0
div(s(z0), s(z1)) → s(div(minus(z0, z1), s(z1)))
Tuples:

MINUS(z0, 0) → c
MINUS(s(z0), s(z1)) → c1(P(minus(z0, z1)), MINUS(z0, z1))
P(s(z0)) → c2
DIV(0, s(z0)) → c3
DIV(s(z0), s(z1)) → c4(DIV(minus(z0, z1), s(z1)), MINUS(z0, z1))
S tuples:

MINUS(z0, 0) → c
MINUS(s(z0), s(z1)) → c1(P(minus(z0, z1)), MINUS(z0, z1))
P(s(z0)) → c2
DIV(0, s(z0)) → c3
DIV(s(z0), s(z1)) → c4(DIV(minus(z0, z1), s(z1)), MINUS(z0, z1))
K tuples:none
Defined Rule Symbols:

minus, p, div

Defined Pair Symbols:

MINUS, P, DIV

Compound Symbols:

c, c1, c2, c3, c4

(3) CdtLeafRemovalProof (BOTH BOUNDS(ID, ID) transformation)

Removed 3 trailing nodes:

P(s(z0)) → c2
DIV(0, s(z0)) → c3
MINUS(z0, 0) → c

(4) Obligation:

Complexity Dependency Tuples Problem
Rules:

minus(z0, 0) → z0
minus(s(z0), s(z1)) → p(minus(z0, z1))
p(s(z0)) → z0
div(0, s(z0)) → 0
div(s(z0), s(z1)) → s(div(minus(z0, z1), s(z1)))
Tuples:

MINUS(s(z0), s(z1)) → c1(P(minus(z0, z1)), MINUS(z0, z1))
DIV(s(z0), s(z1)) → c4(DIV(minus(z0, z1), s(z1)), MINUS(z0, z1))
S tuples:

MINUS(s(z0), s(z1)) → c1(P(minus(z0, z1)), MINUS(z0, z1))
DIV(s(z0), s(z1)) → c4(DIV(minus(z0, z1), s(z1)), MINUS(z0, z1))
K tuples:none
Defined Rule Symbols:

minus, p, div

Defined Pair Symbols:

MINUS, DIV

Compound Symbols:

c1, c4

(5) CdtRhsSimplificationProcessorProof (BOTH BOUNDS(ID, ID) transformation)

Removed 1 trailing tuple parts

(6) Obligation:

Complexity Dependency Tuples Problem
Rules:

minus(z0, 0) → z0
minus(s(z0), s(z1)) → p(minus(z0, z1))
p(s(z0)) → z0
div(0, s(z0)) → 0
div(s(z0), s(z1)) → s(div(minus(z0, z1), s(z1)))
Tuples:

DIV(s(z0), s(z1)) → c4(DIV(minus(z0, z1), s(z1)), MINUS(z0, z1))
MINUS(s(z0), s(z1)) → c1(MINUS(z0, z1))
S tuples:

DIV(s(z0), s(z1)) → c4(DIV(minus(z0, z1), s(z1)), MINUS(z0, z1))
MINUS(s(z0), s(z1)) → c1(MINUS(z0, z1))
K tuples:none
Defined Rule Symbols:

minus, p, div

Defined Pair Symbols:

DIV, MINUS

Compound Symbols:

c4, c1

(7) CdtUsableRulesProof (EQUIVALENT transformation)

The following rules are not usable and were removed:

div(0, s(z0)) → 0
div(s(z0), s(z1)) → s(div(minus(z0, z1), s(z1)))

(8) Obligation:

Complexity Dependency Tuples Problem
Rules:

minus(z0, 0) → z0
minus(s(z0), s(z1)) → p(minus(z0, z1))
p(s(z0)) → z0
Tuples:

DIV(s(z0), s(z1)) → c4(DIV(minus(z0, z1), s(z1)), MINUS(z0, z1))
MINUS(s(z0), s(z1)) → c1(MINUS(z0, z1))
S tuples:

DIV(s(z0), s(z1)) → c4(DIV(minus(z0, z1), s(z1)), MINUS(z0, z1))
MINUS(s(z0), s(z1)) → c1(MINUS(z0, z1))
K tuples:none
Defined Rule Symbols:

minus, p

Defined Pair Symbols:

DIV, MINUS

Compound Symbols:

c4, c1

(9) CdtRuleRemovalProof (UPPER BOUND(ADD(n^1)) transformation)

Found a reduction pair which oriented the following tuples strictly. Hence they can be removed from S.

DIV(s(z0), s(z1)) → c4(DIV(minus(z0, z1), s(z1)), MINUS(z0, z1))
We considered the (Usable) Rules:

p(s(z0)) → z0
minus(z0, 0) → z0
minus(s(z0), s(z1)) → p(minus(z0, z1))
And the Tuples:

DIV(s(z0), s(z1)) → c4(DIV(minus(z0, z1), s(z1)), MINUS(z0, z1))
MINUS(s(z0), s(z1)) → c1(MINUS(z0, z1))
The order we found is given by the following interpretation:
Polynomial interpretation :

POL(0) = 0   
POL(DIV(x1, x2)) = x1   
POL(MINUS(x1, x2)) = 0   
POL(c1(x1)) = x1   
POL(c4(x1, x2)) = x1 + x2   
POL(minus(x1, x2)) = x1   
POL(p(x1)) = x1   
POL(s(x1)) = [1] + x1   

(10) Obligation:

Complexity Dependency Tuples Problem
Rules:

minus(z0, 0) → z0
minus(s(z0), s(z1)) → p(minus(z0, z1))
p(s(z0)) → z0
Tuples:

DIV(s(z0), s(z1)) → c4(DIV(minus(z0, z1), s(z1)), MINUS(z0, z1))
MINUS(s(z0), s(z1)) → c1(MINUS(z0, z1))
S tuples:

MINUS(s(z0), s(z1)) → c1(MINUS(z0, z1))
K tuples:

DIV(s(z0), s(z1)) → c4(DIV(minus(z0, z1), s(z1)), MINUS(z0, z1))
Defined Rule Symbols:

minus, p

Defined Pair Symbols:

DIV, MINUS

Compound Symbols:

c4, c1

(11) CdtRuleRemovalProof (UPPER BOUND(ADD(n^2)) transformation)

Found a reduction pair which oriented the following tuples strictly. Hence they can be removed from S.

MINUS(s(z0), s(z1)) → c1(MINUS(z0, z1))
We considered the (Usable) Rules:

p(s(z0)) → z0
minus(z0, 0) → z0
minus(s(z0), s(z1)) → p(minus(z0, z1))
And the Tuples:

DIV(s(z0), s(z1)) → c4(DIV(minus(z0, z1), s(z1)), MINUS(z0, z1))
MINUS(s(z0), s(z1)) → c1(MINUS(z0, z1))
The order we found is given by the following interpretation:
Polynomial interpretation :

POL(0) = 0   
POL(DIV(x1, x2)) = x12   
POL(MINUS(x1, x2)) = [2]x1   
POL(c1(x1)) = x1   
POL(c4(x1, x2)) = x1 + x2   
POL(minus(x1, x2)) = x1   
POL(p(x1)) = [1] + x1   
POL(s(x1)) = [1] + x1   

(12) Obligation:

Complexity Dependency Tuples Problem
Rules:

minus(z0, 0) → z0
minus(s(z0), s(z1)) → p(minus(z0, z1))
p(s(z0)) → z0
Tuples:

DIV(s(z0), s(z1)) → c4(DIV(minus(z0, z1), s(z1)), MINUS(z0, z1))
MINUS(s(z0), s(z1)) → c1(MINUS(z0, z1))
S tuples:none
K tuples:

DIV(s(z0), s(z1)) → c4(DIV(minus(z0, z1), s(z1)), MINUS(z0, z1))
MINUS(s(z0), s(z1)) → c1(MINUS(z0, z1))
Defined Rule Symbols:

minus, p

Defined Pair Symbols:

DIV, MINUS

Compound Symbols:

c4, c1

(13) SIsEmptyProof (BOTH BOUNDS(ID, ID) transformation)

The set S is empty

(14) BOUNDS(1, 1)